package com.neusoft.movie.v_movies.model;


import com.neusoft.movie.v_movies.common.Constants;
import com.neusoft.movie.v_movies.listener.RetrofitListener;
import com.neusoft.movie.v_movies.service.MoviesService;

import retrofit2.Call;

/**
 * Created by Administrator on 2017/12/26.
 */

public class MoviesModel extends RetrofitBaseModel {
    private MoviesService moviesService;


    public MoviesModel() {
        this.moviesService = retrofit.create(MoviesService.class);
    }

    public void getMovieslist(RetrofitListener listener) {
        Call call = moviesService.getMovieslist();
        bindCallback(call, listener, Constants.GETMOVIESLIST);
    }

    public void getDetail(int m_id,RetrofitListener listener) {
        Call call = moviesService.getDetail(m_id);
        bindCallback(call, listener, Constants.GETMOVIESDETAIL);
    }

//    public void getMoviesCommentlist(int comment_id,int comment_flag,RetrofitListener listener) {
//        Call call = moviesService.getMoviesCommentlist(comment_id,comment_flag);
//        bindCallback(call, listener, Constants.GETMOVIESCOMMENTLIST);
//    }

//    public void collectstate(int u_id, int collect_id, int collect_flag, RetrofitListener listener) {
//        Call call = moviesService.collectstate(u_id,collect_id,collect_flag);
//        bindCallback(call,listener,Constants.ISCOLLECT);
//    }


    public void searchMovies(String m_name, RetrofitListener listener) {
        Call call = moviesService.searchMovies(m_name);
        bindCallback(call,listener,Constants.SEARCHMOVIES);
    }

}
